\documentclass[12pt]{article}


% Include Theme
\input{preamble.tex}

% \maketitle info
\title{Example Paper}
\author{
    \href{https://kylebutts.com/}{Kyle Butts}\thanks{University of Colorado, Boulder. Email: \href{mailto:buttskyle96@gmail.com}{buttskyle96@gmail.com}.} % \ and Other Author
}
\date{\today}

% pdf info
\hypersetup{pdftitle={Example Paper}, pdfauthor={Kyle Butts}}

\begin{document}

% Title Page -------------------------------------------------------------------
\maketitle
\begin{abstract}
    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    \par~\par\noindent
    JEL-Classification: 
    \par\noindent
    Keywords: 
    \par
\end{abstract}

\newpage


% Paper ------------------------------------------------------------------------

% ------------------------------------------------------------------------------
\section{Introduction}
% ------------------------------------------------------------------------------

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur: $\sum X_i$. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\footnote{This is a test.}

See below for Theorem \ref{residue_thm}, for the regression specification Equation \ref{fe_reg}, and for Table \ref{summ_stat}, appendix table \ref{reg1}, and citation \citet{Eigen1971}.

% ------------------------------------------------------------------------------
\section{Econometric Model}
% ------------------------------------------------------------------------------

% ------------------------------------------------------------------------------
\subsection{Principal Specification}
% ------------------------------------------------------------------------------

\begin{theorem}[Example Theorem]\label{residue_thm}
    This is an example theorem \[ 
        \hat{\beta}=\frac{\sum_{\ell}e_{\ell}z_{\ell}y_{\ell}^{\perp}}{\sum_{\ell}e_{\ell}z_{\ell}x_{\ell}^{\perp}}
    \]
\end{theorem}

Example numbered and non-numbered equations
\begin{equation}\label{fe_reg}
    y = f(X) + \varepsilon = X \beta + \psi_i + \nu_t + w_{i,t} + \varepsilon_{i,t} 
\end{equation}

\[ 
    \expec{Y_i(1) - Y_i(0)} = \prob{\tau \ \vert \ \one(D_i = 1)} 
\]




\begin{table}[ht]
    \caption{Table Too Wide (adjustbox)}
    \centering

    \begin{adjustbox}{width = 1.1\textwidth, center}
        \begin{threeparttable}
            \begin{tabular}{@{} @{\extracolsep{5pt}} 
                    lrrrrrrrr 
                @{}}
                % Head
                \toprule
                & & & \multicolumn{2}{c}{Market Access} & \multicolumn{2}{c}{Urban Weekly Wage} & \multicolumn{2}{c}{Nonurban Weekly Wage} \\
                \cmidrule{4-5} \cmidrule{6-7} \cmidrule{8-9}
                Year & \multicolumn{1}{c}{N} & \% Urban & Mean & SD & Mean & SD & Mean & SD \\ 
                \hline 

                % Body
                \input{summary.tex}

                \\\bottomrule
            \end{tabular}

            % Notes 
            \begin{tablenotes}
                \item \textit{Notes.} Weekly wage is reported in 2015 \$.
            \end{tablenotes}
        \end{threeparttable}    
    \end{adjustbox}
\end{table}

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

% in Preamble:
% \usepackage{pdflscape} - rotates page left-side up in pdf
% \usepackage{lscape} - does not rotate page, only figure/table

\begin{landscape}
%\thispagestyle{empty}
\thispagestyle{lscaped}

\begin{table}[h!]
    \caption{Landscape Table}
    \centering
    
    \begin{adjustbox}{width = 1.2\textwidth, center}
        \begin{threeparttable}
        \begin{tabular}{@{} @{\extracolsep{5pt}} 
                lrrrrrrrr 
            @{}}
            % Head
            \toprule
            & & & \multicolumn{2}{c}{Market Access} & \multicolumn{2}{c}{Urban Weekly Wage} & \multicolumn{2}{c}{Nonurban Weekly Wage} \\
            \cmidrule{4-5} \cmidrule{6-7} \cmidrule{8-9}
            Year & \multicolumn{1}{c}{N} & \% Urban & Mean & SD & Mean & SD & Mean & SD \\ 
            \hline 

            % Body
            \input{summary.tex}

            \bottomrule
        \end{tabular}
        
        % Notes
        \begin{tablenotes}\footnotesize
            \item \textit{Notes.} Weekly wage is reported in 2015 \$. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
        \end{tablenotes}
        \end{threeparttable}
    \end{adjustbox}
\end{table}
\end{landscape}

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.




\begin{table}[tb] 
    \caption{Summary Statistics (tabularx)}
    \label{summ_stat}

    \begin{adjustbox}{center}
        \begin{threeparttable}
            \begin{tabularx}{\textwidth}{@{} 
                    >{\hsize=.9\hsize}R >{\hsize=1.1\hsize}R >{\hsize=1.1\hsize}R >{\hsize=.9\hsize}R
                @{}}
                
                % Head
                \toprule
                & \multicolumn{2}{c}{\textbf{Population}} & \\
                \cmidrule{2-3}
                \textbf{Country} & 2016 & 2017 & \textbf{Change (\%)} \\
                
                % Body
                \hline
                China & 1,403,500,365 & 1,409,517,397 & +0.4\% \\
                India & 1,324,171,354 & 1,339,180,127 & +1.1\% \\
                United States & 322,179,605 & 324,459,463 & +0.7\% \\
                Indonesia & 261,115,456 & 263,991,379 & +1.1\% \\
                Brazil & 207,652,865 & 209,288,278 & +0.8\% \\
                Pakistan & 193,203,476 & 197,015,955 & +2.0\% \\
                Nigeria & 185,989,640 & 190,886,311 & +2.6\% \\
                Bangladesh & 162,951,560 & 164,669,751 & +1.1\% \\
                Russia & 146,864,513 & 143,989,754 & -2.0\% \\
                Mexico & 127,540,423 & 129,163,276 & +1.3\% \\
                
                \bottomrule
            \end{tabularx}
            
            % Notes
            \begin{tablenotes}\setlength\labelsep{0pt}\small
                \item \textit{Source:} \href{https://en.wikipedia.org/wiki/List_of_countries_by_population_(United_Nations)}{Wikipedia}.
            \end{tablenotes}
        \end{threeparttable}
    \end{adjustbox}
\end{table} 

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 


% ------------------------------------------------------------------------------
\newpage
\bibliography{references.bib}
% ------------------------------------------------------------------------------


% ------------------------------------------------------------------------------
\newpage
\appendix
\numberwithin{equation}{section}
\numberwithin{figure}{section}
\numberwithin{table}{section}
\renewcommand{\thefigure}{\Alph{section}\arabic{figure}}
\renewcommand{\thetable}{\Alph{section}\arabic{table}}
% ------------------------------------------------------------------------------

% ------------------------------------------------------------------------------
\section{Additional Results}
% ------------------------------------------------------------------------------

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 

% ------------------------------------------------------------------------------
\subsection{Regression Results}
% ------------------------------------------------------------------------------

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 


\begin{table}[tb] 
    \caption{Regression Results (Custom tabularx widths)} 
    \label{reg1}

    \begin{adjustbox}{center}
        \begin{tabularx}{\textwidth}{@{} 
                >{\hsize=.6\hsize}L >{\hsize=.4\hsize}R >{\hsize=.4\hsize}R 
            @{}} 

            % Head
            \hline \hline
            & \multicolumn{2}{c}{\textit{Dependent variable:} \ Overall Rating} \\ 
            \cmidrule{2-3} 
            & (1) & (2) \\ 
            \hline

            % Body
            Handling of Complaints & 0.692$^{***}$ (0.149) & 0.682$^{***}$ (0.129) \\ 
            No Special Privileges & $-$0.104 (0.135) & $-$0.103 (0.129) \\ 
            Opportunity to Learn & 0.249 (0.160) & 0.238$^{*}$ (0.139) \\ 
            Performance-Based Raises & $-$0.033 (0.202) &  \\ 
            Too Critical & 0.015 (0.147) &  \\ 
            Advancement & 11.011 (11.704) & 11.258 (7.318) \\ 
            \hline 
            Observations & 30 & 30 \\ 
            Adjusted R$^{2}$ & 0.656 & 0.682 \\ 
            
            % Notes
            \hline \hline \\[-5mm]
            \multicolumn{3}{@{} p{\textwidth}}{\small \textit{Notes.} $^{*}$ p$< 0.1$; $^{**}$ p$< 0.05$; $^{***}$ p$< 0.01$} \\ 
            \multicolumn{3}{@{} p{\textwidth}}{\small Using R base dataframe attitude. dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. } 
        \end{tabularx} 
    \end{adjustbox}
\end{table}


\end{document}